package com.zhx.rabbit.sender;


import com.zhx.rabbit.config.RabbitMQConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @author zhanghaixuan
 * @date 2020-02-22 12:48
 */


@Slf4j
@Component
public class Sender {

    @Autowired
    private AmqpTemplate amqpTemplate;

    public void sendTopic() {
        amqpTemplate.convertAndSend("mybootexchange", "topic.message", "topic.message");
        amqpTemplate.convertAndSend("mybootexchange", "topic.messages", "topic.messages");
    }
}
